Release 10.1A: OpenEdge Development:
Java Open Clients
Accessing TABLE or TABLE-HANDLE parameters as OUTPUT
For both
outputTABLEandTABLE-HANDLEparameters andINPUT-OUTPUTTABLEandTABLE-HANDLEparameters (on output), you must obtain the outputProResultSetobject from the ResultSetHolder class and call its methods to get the data. As explained previously,com.progress.open4gl.ProResultSetextends thejava.sql.ResultSetinterface.In addition to the standard flat model for viewing individual columns presented by
ResultSetobjects,ProResultSetallows you to view the object using the Progress array model, which presents a temp-table as individual fields that can contain arrays. You can choose whichever model is most natural or convenient. For more information on the Progress field model, see OpenEdge Development: Open Client Introduction and Programming .Standard methods in the ProResultSet interface
The standard methods include the methods of
java.sql.ResultSet, which use the flat column model. The primary methods in this set are described below.The following method advances the
ResultSetcursor to the next row:
The following method closes the
ResultSet:
For output
ResultSetobjects, theclose()method may be called to close theResultSetbefore all the rows have been fetched. No other AppServer method can be called until all the rows are fetched orclose()is called.The following method returns the value of the column identified by the 1-based
columnNum:
The data type of the returned object is the default data type of the column. For example, the default data type for a 4GL
CHARACTERfield isjava.lang.String. For more information, see the "Data type mapping for temp-table fields" section.The following method returns the value of the column identified by the
fieldName:
The data type of the returned object is the default data type of the field. For example, the default data type for a 4GL
CHARACTERfield isjava.lang.String. For more information, see the "Data type mapping for temp-table fields" section.The following method returns the value of the column identified by the 1-based
columnNum:
DataTypeis the name of the data type, for example,String getString(),Integer getInteger(), and so on.The following method returns the value of the column identified by the
fieldName:
DataTypeis the name of the data type; for example,StringgetString(),IntegergetInteger(), and so on.If the specified return
DataTypeis different from the default data type of the column, the Open Client takes one of the following actions:For example, if the 4GL data type is
INTEGERand its value is 10,getString(columnNum) automatically converts the value fromIntegerto thejava.lang.String, “10”. If the application callsgetDate(columnNum), an exception is thrown with the message that anIntegervalue cannot be converted toDate. For information on the supported conversions, see Table C–6.ProResultSet interface extensions to java.sql.ResultSet
ProResultSetadds the following methods not found injava.sql.ResultSet, whereDataTypeis the name of the data type. These extensions allow your application to access the data in aResultSetbased on the Progress array model (see the "Accessing temp-table array fields" section).The following method returns the value of the
arrayIndexelement of the array field identified byfieldNum:
The data type of the object is the default data type of the
arrayIndex. ThearrayIndexandfieldNumare 1-based.The following method returns the value of the
arrayIndexelement of the array field identified byfieldName:
The data type of the object is the default data type of the array field. The
arrayIndexandfieldNameare 1-based.The following method returns the array field identified by
fieldNum:
DataTypeis the name of the data type; for example,StringgetString(),IntegergetInteger(), and so on. ThearrayIndexandfieldNumare 1-based.The following method returns the array field:
DataTypeis the name of the data type; for example,StringgetString(),IntegergetInteger(), and so on. ThearrayIndexandfieldNameare 1-based.For example, here is the syntax for methods that return a value for a
Stringand anIntegerarray element of a temp-table field:
For a complete listing of the methods implemented by the
ProResultSetinterface, see the documentation inOpenEdge-install-directory/java/doc/.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |